package site.yunnong.atvris.portal.config;

import com.aliyun.oss.OSSClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zjh
 * @date 2021/7/24 19:20
 */
@Configuration
public class AliyunConfig {

    @Value("${aliyun.oss.accessKeyId}")
    private String ALIYUN_OSS_ACCESSKEYID;
    @Value("${aliyun.oss.accessKeySecret}")
    private String ALIYUN_OSS_ACCESSKEYSECRET;
    @Value("${aliyun.oss.endpoint}")
    private String ALIYUN_OSS_END_POINT;
    
    @Bean
    public OSSClient ossClient() {
        return new OSSClient(ALIYUN_OSS_END_POINT, ALIYUN_OSS_ACCESSKEYID, ALIYUN_OSS_ACCESSKEYSECRET);
    }
    
}
